package com.zmn.oms.dubbo.interfaces.redistridute;

import com.zmn.common.dto2.AMISListData;
import com.zmn.common.dto2.ResponseDTO;
import com.zmn.oms.common.dio.redistribute.*;
import com.zmn.oms.common.dio.redistribute.audit.ManagerAuditQuery;
import com.zmn.oms.common.dro.redistribute.*;
import com.zmn.oms.common.dro.redistribute.audit.ApplyDetailDRO;
import com.zmn.oms.common.dro.redistribute.audit.ApplyItemDRO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * @author sunlife
 * @date:2022/5/9 下午4:17
 * description:
 */
@Api("工程师改派查询业务类")
public interface OrderWorkRedistributeListRemoteService {

    @ApiOperation("检查工程师端是否可以操作改派")
    ResponseDTO<CheckOperateDRO> checkCanOperateRedistribute(@Valid @NotNull(message = "orderId不能为空") Long orderId, @Valid@NotNull(message = "workId不能为空") Long workId);


    @ApiOperation("检查工程师端提交的数据是否可以申请改派")
    ResponseDTO<CheckApplyRedistributeDRO> checkCanApplyRedistribute(@Valid CheckApplyRedistributeDIO checkApplyRedistributeDIO);

    /**
     * 校验在途重复
     *
     * @param dio
     * @return
     */
    @ApiOperation(value = "校验在途重复", response = ResponseDTO.class, notes = "校验在途重复")
    ResponseDTO<Boolean> checkServingDuplicateOrder(@NotNull(message = "入参不能为空") OrderWorkRedistributeDuplicateDIO dio);

    @ApiOperation("获取求助抢单列表")
    ResponseDTO<List<EngineerWorkRedistributeDRO>> listGrabWorkByQuery(@Valid EngineerWorkRedistributeQuery engineerWorkRedistributeQuery);

    @ApiOperation("获取审核列表")
    ResponseDTO<AMISListData<ApplyItemDRO>> listApplyByQuery(@Valid ManagerAuditQuery query);

    @ApiOperation("获取审核详情")
    ResponseDTO<ApplyDetailDRO> getApplyById(@Valid @NotNull(message = "改派申请ID不能为空") Long redistributeId);

    @ApiOperation("获取审核详情")
    ResponseDTO<List<ApplyDRO>> getApplyByOrderIdAndWorkId(@Valid @NotNull(message = "orderId不能为空") Long orderId, @Valid @NotNull(message = "workId不能为空") Long workId);

    @ApiOperation("获取改派工程师列表")
    ResponseDTO<List<EngineerDRO>> listAutoRedistributeEngineer(@Valid @NotNull(message = "orderId不能为空") Long orderId, @Valid @NotNull(message = "workId不能为空") Long workId, Date dutyTime);

    @ApiOperation("获取改派工程师列表")
    ResponseDTO<List<EngineerDRO>> listRedistributeEngineer(EngineerRedistributeQuery query);

    @ApiOperation("获取改派相关状态")
    ResponseDTO<OrderWorkRedistributeStatusDRO> getRedistributeStatusById(@Valid @NotNull(message = "改派申请ID不能为空") Long redistributeId);
}
